package com.scut.dispatching_server.post_step;

import com.scut.dispatching_server.config.GlobalVariables;
import com.scut.dispatching_server.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author lnj
 * createTime 2018-11-07 22:25
 **/
@Component
public class RedisPost implements CommandLineRunner {
    @Autowired
    private RedisUtil redisUtil;
    @Override
    public void run(String... args) throws Exception {
        redisUtil.flsuhDB();
        redisUtil.set(GlobalVariables.SUCCESS_DEMAND_COUNT, 0);
        redisUtil.set(GlobalVariables.ROUND_DEMAND_COUNT, 0);
        redisUtil.set(GlobalVariables.EXPIRED_DEMAND_COUNT, 0);
        GlobalVariables.isDispatchingBegin = true;
    }
}
